package com.lpf.demo;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Runtime02 {
    public static void main(String[] args) {
        Process proc;
        try {
            String[] aaa = new String[]{"E:\\DevelopTools\\Python310\\python.exe", "E:\\IdeaProjects\\java-learning\\07-java-python\\src\\main\\resources\\demo\\runtime02.py", "单点"};
            proc = Runtime.getRuntime().exec(aaa);
            BufferedReader in = new BufferedReader(new InputStreamReader(proc.getInputStream(), "GBK"));
            String line;
            while ((line = in.readLine()) != null) {
                System.out.println(line);
            }
            in.close();
            proc.waitFor();
        } catch (IOException | InterruptedException e) {
            e.printStackTrace();
        }
    }
}
